<?php

namespace Bigspender\DefaultBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class LoginType extends AbstractType
{

    private $lastUsername = '';

    function __construct($lastUsername = '') 
    {
            $this->lastUsername = $lastUsername;
    }

    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add(
            '_username', 
            'text', 
            array(
                'label' => 'LOGIN EMAIL LABEL',
                'attr' => 
                    array(
                        'class' => 'form-control', 
                        'value' => $this->lastUsername,
                    )
            )
        );

        $builder->add(
            '_password', 
            'password', 
            array(
                'label' => 'LOGIN PASSWORD LABEL',
                'attr' => 
                array(
                    'class' => 'form-control'
                )
            )
        );



        $builder->add(
            'login', 
            'submit', 
            array(
                'label' => 'LOGIN SUBMIT LABEL',
                'attr' => 
                array(
                    'class' => 'btn btn-success')
                )
            );
    }

    public function getName()
    {
        return null;
    }
}
